<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>

<div data-property="textCombineUpright">
  <div style="-webkit-text-combine: none" data-expected="none"></div>
  <div style="-webkit-text-combine: horizontal" data-expected="all"></div>
  <div style="-epub-text-combine: none" data-expected="none"></div>
  <div style="-epub-text-combine: horizontal" data-expected="all"></div>
</div>

<div data-property="webkitTextCombine">
  <div style="text-combine-upright: all" data-expected="horizontal"></div>
</div>

<div data-property="textOrientation">
  <div style="-webkit-text-orientation: vertical-right" data-expected="mixed"></div>
  <div style="-webkit-text-orientation: upright" data-expected="upright"></div>
  <div style="-webkit-text-orientation: sideways" data-expected="sideways"></div>
  <div style="-webkit-text-orientation: sideways-right" data-expected="sideways"></div>
  <div style="-epub-text-orientation: vertical-right" data-expected="mixed"></div>
  <div style="-epub-text-orientation: upright" data-expected="upright"></div>
  <div style="-epub-text-orientation: sideways" data-expected="sideways"></div>
  <div style="-epub-text-orientation: sideways-right" data-expected="sideways"></div>
</div>

<div data-property="webkitTextOrientation">
  <div title="Initial value of webkitTextOrientation" data-expected="vertical-right"></div>
  <div style="text-orientation: mixed" data-expected="vertical-right"></div>
</div>

<div data-property="unicodeBidi">
  <div style="unicode-bidi: -webkit-isolate" data-expected="isolate"></div>
  <div style="unicode-bidi: -webkit-isolate-override" data-expected="isolate-override"></div>
  <div style="unicode-bidi: -webkit-plaintext" data-expected="plaintext"></div>
</div>

<div data-property="writingMode">
  <div title="Initial value of writingMode" data-expected="horizontal-tb"></div>
  <div style="-webkit-writing-mode: vertical-lr" data-expected="vertical-lr">
    <div style="-webkit-writing-mode: horizontal-tb" data-expected="horizontal-tb"></div>
  </div>
  <div style="-webkit-writing-mode: vertical-rl" data-expected="vertical-rl"></div>
</div>

<div data-property="webkitWritingMode">
  <div title="Initial value of webkitWritingMode" data-expected="horizontal-tb"></div>
  <div style="writing-mode: vertical-lr" data-expected="vertical-lr">
    <div style="writing-mode: horizontal-tb" data-expected="horizontal-tb"></div>
  </div>
  <div style="writing-mode: vertical-rl" data-expected="vertical-rl"></div>
</div>

<script>
Array.prototype.forEach.call(document.querySelectorAll("[data-property]"), function (element) {
  var property = element.dataset.property;
  Array.prototype.forEach.call(element.querySelectorAll("[data-expected]"), function (element) {
    var expected = element.dataset.expected;
    test(function () {
      var actual = getComputedStyle(element)[property];
      assert_equals(actual, expected);
    }, (element.title || property + " of '" + element.getAttribute("style") + "'") + " should be '" + expected + "'");
  });
});
</script>
